<?php 
$temp = 0;
//$this->load->database();
foreach ($query->result() as $res):
		$nope = "";
		$nun = "";	
		$q = $this->db->query("select no_peserta,wawancara,nilai_nun from wawancara where no_ujian='$res->no_ujian' limit 1");
		foreach ($q->result() as $re):
			$res->wawancara = $re->wawancara;
			$nope = $re->no_peserta;
			$nun = $re->nilai_nun;
		endforeach;
		
		$na = (($nun*2)+($res->pesikotes*2)+$res->wawancara)/5;
	if($res->no_ujian!=0){
		if($temp=='#eee'){
	 		$bg='#ccc';
			$bgcount = '#FFEE79';
	 		$temp = 1;
	 	} else {
	 		$bg='#eee';
			$bgcount = '#FFFABB';
	 		$temp = 0;
		}
	}
?>
<tr bgcolor="<?php echo $bg?>" align="center">
      <td><?php echo $res->no_ujian ?></td>
      <td><?php echo $nope ?></td>
      <td align="left"><?php echo $res->name ?></td>
      <td><?php echo $res->birthday ?></td>
      <td><?php echo $nun ?></td>
      <td><?php echo $res->pesikotes ?></td>
      <td><?php echo $res->wawancara ?></td>
      <td><?php echo $na ?></td>
      <td>
      <a href="javascript: add('<?php echo $res->no_ujian?>')">[edit]</a>
      </td>
</tr>
<?php 
endforeach;
?>